<template>
  <el-button :type="type" v-if="hasPermission()" size="small" @click="clickEvent">
    <slot />
  </el-button>
  <!-- <el-link :type="type" v-if="link && hasPermission()">
      <slot />
    </el-link> -->
</template>
<script>
export default {
  name: "AuthButton",
  props: {
    uid: {
      type: [String, Number],
      default: "",
    },
    type: {
      type: [String, Number],
      default: "default",
    },
    link: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {
    // 判断是否有权限
    hasPermission() {
      // let id = this.uid;
      // let list = this.$store.state.currentPermission;
      // let idx = list.findIndex((k) => k.id == id);
      // if (idx < 0) {
      //   return false;
      // } else {
      //   return true;
      // }
    },

    // 点击事件
    clickEvent() {
      this.$emit("click");
    },
  },
};
</script>
<style lang="scss" scoped>
</style>